package com.douwong.student.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * @autor yichao
 * @time 2016/11/717:30
 * @des 题目类型
 */
public enum E_SubjectType {
    /**单选题*/
    single(1),
    /**多选题*/
    multiple(2),
    /**填空题*/
    completion(3),
    /**判断题*/
    judgment(15);
    private int value;

    E_SubjectType(int value) {
        this.value = value;
    }
    public void setValue(int value){
        this.value=value;
    }
    @JsonValue
    public int getValue() {
        return value;
    }
    @JsonCreator
    public static E_SubjectType getItem(int value){
        for(E_SubjectType item :values()){
            if (item.getValue()==value){
                return item;
            }
        }
        return null;
    }
}
